//
//  ThemeDescCollectionViewCell.m
//  wedding
//
//  Created by 常宽 on 15/1/28.
//  Copyright (c) 2015年 常宽. All rights reserved.
//

#import "ThemeDescCollectionViewCell.h"

#import "ThemeModel.h"

@interface ThemeDescCollectionViewCell ()
/// 标题
@property (nonatomic, retain)UILabel *titleLabel;
/// 描述
@property (nonatomic, retain)UILabel *descLabel;

@end

@implementation ThemeDescCollectionViewCell

- (instancetype) initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.descLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.descLabel];
        
        self.titleLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.titleLabel];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(10, 10, self.contentView.frame.size.width - 20, 30);
    self.titleLabel.font = [UIFont boldSystemFontOfSize:13.f];
    self.titleLabel.textColor = [WebColor whiteSmoke];
    self.titleLabel.textAlignment = NSTextAlignmentLeft;
    self.titleLabel.numberOfLines = 0;
    
    self.descLabel.frame = CGRectMake(10, 10, self.contentView.frame.size.width - 20, self.contentView.frame.size.height - 20);
    self.descLabel.font = [UIFont boldSystemFontOfSize:12.f];
    self.descLabel.textColor = [WebColor whiteSmoke];
    self.descLabel.textAlignment = NSTextAlignmentLeft;
    self.descLabel.numberOfLines = 0;
    
}
- (void)setModel:(ThemeModel *)model
{
    if (_model != model) {
        _model = model;
    }
    self.descLabel.text = _model.desc;
    self.titleLabel.text = _model.title;
}


@end
